<?php
	class UserView
	{
		// Constants
		const USERNAME = "Username";
		const PASSWORD = "Password";
		const ADMIN = 5;
		const USER = 0;
		const DATABASEERROR = "A database related error occured.";

		// Logs the message for when a user was added to the database.
		public function UserAddedMessage(\User $user)
		{
			Log::LogMessage("Account succesfully created.");
		}	
		
		// Logs the message for when adding a user to the database fails.
		public function UserFailedToAddMessage()
		{
			Log::LogError(UserView::DATABASEERROR, "Failed to add user to the database.");
		}
		
		// Logs the message for when removing a user from the database fails.
		public function FailedToRemoveUserMessage($username)
		{
			Log::LogError(UserView::DATABASEERROR, "Failed to remove user: " . $username . " from the database.");
		}
		
		// Logs the message for when a user was removed from the database.
		public function UserRemovedMessage($username)
		{
			Log::LogMessage("User with username: " . $username . " was removed from the database.");
		}
		
		// Returns the formated memberlist.
		public function PrintMemberlist(Array $userlist)
		{
			$navView = new NavigationView();
			$ret = "<br /><b>Memberlist</b><br />";
			
			foreach($userlist as $user)
			{
				$ret .= "<a href='" . $navView->GetMemberProfileAdress() . "$user->username" . "' methed='post'>$user->username</a><br />";
			}
			
			return $ret;
		}	
	}